<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>根据当前时间显示问候语</title>
	</head>
	<body>
		<div id="regards"></div>
		<script type="text/javascript">
			var today=new Date();
			var say;
			var hh=today.getHours();
			if(hh>18){
				say="晚上好";
			}else if(hh>12){
				say="下午好";
			}else{
				say="上午好";
			}
			document.getElementById("regards").innerHTML="今天日期："+today.getFullYear()
			+"年"+(today.getMonth()+1)+"月"+today.getDate()+"日"+"<br/>"+
			"现在时间："+hh+"点"+today.getMinutes()+"分"+"<br/>"+
			say+"!欢迎来到鬼魅";
		</script>
	</body>
</html>
